USE [vudu]
GO
/****** Object:  StoredProcedure [dbo].[EstudianteHorario]    Script Date: 05/27/2011 05:38:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[AgregarMateriasEH] 
	@NumPreMatricula int,
    @IdSeccionMateria int,
    @IdPractica int

AS
BEGIN
	SET NOCOUNT ON;
	IF (@IdPractica = 0)
	BEGIN
	
	INSERT INTO [vudu].[dbo].[EstudianteHorario] (fk_HorarioPreMatricula,fk_SeccionMateria)
											VALUES(@NumPreMatricula,@IdSeccionMateria)
      END
     ELSE
       BEGIN
        
         INSERT INTO [vudu].[dbo].[EstudianteHorario] (fk_HorarioPreMatricula, fk_Practica,fk_SeccionMateria)
												VALUES(@NumPreMatricula,@IdPractica,@IdSeccionMateria)
        
         END  
           
END
